package com.cy.store.util;

import java.io.Serializable;

/**
 * Json格式的数据进行响应
 * @param <E>
 */
public class JsonResults<E> implements Serializable {
    private Integer state;//响应状态码
    private String message;//响应信息
    private E data;//数据,不确定数据类型使用泛型

    public JsonResults() {
    }

    public JsonResults(Integer state) {
        this.state = state;
    }

    public JsonResults(Throwable e) {
        this.message = e.getMessage();
    }

    public JsonResults(Integer state, E data) {
        this.state = state;
        this.data = data;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }
}
